  <extend name="Public/base"/>
  <block name="style">
    <!--此页面增加的style-->
  </block>

  <block name="body">

        <div class="builder-tabs builder-form-tabs">
            <ul class="nav nav-tabs">
                <li class=""><a href="{:U('role_edit',array('group_id'=>$role_id))}">角色信息</a></li>
                <li class=""><a href="{:U('access',array('group_id'=>$role_id))}">权限分配</a></li>
                <li class=""><a href="{:U('accessUser',array('group_id'=>$role_id))}">成员授权</a></li>
                <li class="right form-group mt0 mr20">
                    <select name="group" class="form-control col-md-8">
                        <volist name="auth_group" id="vo">
                            <option value="{:U('AuthManager/user',array('group_id'=>$vo['id'],'group_name'=>$vo['title']))}" <eq name="vo['id']" value="$this_group['id']">selected</eq> >{$vo.title}</option>
                        </volist>
                    </select>
                </li>
            </ul>
            <div class="form-group"></div>
        </div>

    <div class="builder-container listbuilder-box">

    <div class="row">    

        <div class="builder-table">      
            <!-- 数据列表 -->
            <div class="data-table table-striped">
            <table class="table table-hover table-responsive">
            <thead>
                <tr>
                <th class="">UID</th>
                <th class="">昵称</th>
                <th class="">最后登录时间</th>
                <th class="">最后登录IP</th>
                <th class="">状态</th>
                <th class="">操作</th>
                </tr>
            </thead>
            <tbody>
                <volist name="_list" id="vo">
                <tr>
                    <td>{$vo.uid} </td>
                    <td>{$vo.nickname}</td>
                    <td><span>{$vo.last_login_time|time_format}</span></td>
                    <td><span>{$vo.last_login_ip|long2ip}</span></td>
                    <td>{$vo.status_text}</td>
                    <td><a href="{:U('Auth/removeFromGroup?uid='.$vo['uid'].'&group_id='.I('group_id'))}" class="ajax-get">解除授权</a>

                        </td>
                </tr>
                </volist>
            </tbody>
            </table>

            </div>
            <div class="main-title">
                <div class="page_nav fl">
                    {$_page}
                </div>
                <div id="add-to-group" class="tools fr">
                    <form class="add-user" action="{:U('addToGroup')}" method="post" enctype="application/x-www-form-urlencoded" >
                    <div class="form-group">
                        <div class="col-md-8">
                            <input class="form-control" type="text" name="uid" placeholder="请输入uid,多个用英文逗号分隔">
                        </div>
                        <input type="hidden" name="group_id" value="{:I('group_id')}">
                        <button type="submit" class="btn btn-info btn-raised btn-sm ajax-post" target-form="add-user">新 增</button>
                    </div>
                    </form>
                </div>
            </div>
                      
    </div>    
   </div>
 </div>

  </block>

  <block name="script">
    <script type="text/javascript">
        $(function(){
            //遍历选中当前权限的子权限
            $('.auth input[type="checkbox"]').on('change',function(){
                $('.'+$(this).attr('data-module-name')+' .auth'+$(this).val()).find('input').prop('checked',this.checked);
            });
        });
    </script>
  </block>